<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="va" tagdir="/WEB-INF/tags"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>JS表单验证</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<va:importPath path="jsValidator" useDatePicker="true"
			usingRegx="true" />
		<va:initConfig formid="form1" onerror="showError" />
		<script type="text/javascript">
			var showError=function(msg){
				var asegfse  =document.getElementById("showPanl");
				asegfse.style.display="block";
				asegfse.innerHTML=msg;
				setTimeout("document.getElementById('showPanl').style.display='none';",1000);
			}
		</script>
		<style type="text/css">
<!--
#showPanl {
	position: absolute;
	width: 30%;
	height: 4%;
	z-index: 1;
	left: 40%;
	top: 5%;
}
-->
</style>
	</head>
	<body>
		<div id="showPanl" class="onError" style="display: none;"></div>
		<form action="sjv/aa" id="form1">
			<table>
				<tr>
					<td colspan="3">

					</td>
				</tr>
				<tr>
					<td>
						用户名:
					</td>
					<td>
						<input name="name" type="text" id="name" />
					</td>
					<td>
						<va:formValidator id="name" onshow="用户名字" onfocus="正在输入信息"
							oncorrect="输入正确了">
							<jsp:attribute name="inputValidator" trim="true">
								<va:inputValidator min="6" max="10" onerror="输入错误" />
							</jsp:attribute>
						</va:formValidator>
					</td>
				</tr>
				<tr>
					<td>
						密码:
					</td>
					<td>
						<input name="pwd" type="text" id="pwd" />
					</td>
					<td>
						<va:formValidator id="pwd" onshow="密码" onfocus="正在输入密码"
							oncorrect="密码输入正确了">
							<jsp:attribute name="inputValidator" trim="true">
								<va:inputValidator min="6" max="16" onerror="输入错误" />
							</jsp:attribute>
						</va:formValidator>
					</td>
				</tr>
				<tr>
					<td>
						重复密码:
					</td>
					<td>
						<input name="rename" type="text" id="rename" />
					</td>
					<td>
						<va:formValidator id="rename" onshow="重复密码" onfocus="正在输入重复密码"
							oncorrect="重复密码输入正确了">
							<jsp:attribute name="inputValidator" trim="true">
								<va:inputValidator max="16" min="6" onerror="输入错误"
									onerrormax="输入太长了" onerrormin="输入太短了" />
							</jsp:attribute>
							<jsp:attribute name="compareValidator" trim="true">
								<va:compareValidator desid="pwd" operateor="=" onerror="两次密码不对"></va:compareValidator>
							</jsp:attribute>
						</va:formValidator>
					</td>
				</tr>
				<tr>
					<td>
						年龄:
					</td>
					<td>
						<input name="age" type="text" id="age" />
					</td>
					<td>
						<va:formValidator id="age" onshow="年龄只能在1-99之间" onfocus="正在输入年龄"
							oncorrect="年龄输入正确了" onempty="年龄不能为空">
							<jsp:attribute name="inputValidator" trim="true">
								<va:inputValidator min="14" max="66" onerror="输入错误" type="value"
									onerrormax="您输入的年龄太大了" onerrormin="您输入的年龄太小了" />
							</jsp:attribute>
						</va:formValidator>
					</td>
				</tr>
				<tr>
					<td>
					</td>
					<td>
						<input type="submit" value="注册" />
					</td>
					<td>
					</td>
				</tr>
			</table>
		</form>
	</body>
</html>
